package org.idontknow.heritence;

class Son extends Parent {

  private Integer data;

  public Son() {

//    System.out.println("Entering constructor of Son class...");
//    System.out.println("Calling constructor of Parent class...");
    super();
    System.out.println("Parent constructor call finished");
    System.out.println("Quitting constructor of Son class...\n");
  }

  public void test() {

    System.out.println("Entering overrided method \"test\"...");
    System.out.println("Initializing private data...");
    data = new Integer(65535);
    System.out.println("Quitting overrided method \"test\"...");
  }

  public Integer getData() {
    
    System.out.println("Entering method \"getData\" of Son class...");
    if(data == null)
      System.out.println("Now the data is null!");
    else
      System.out.println("Data is not null!");
    System.out.println("Quitting method \"getData\" of Son class...");
    return data;
  }
}
